Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discard out-of-bounds binned breaks after generating labels #6061

Merged
merged 7 commits into from
Dec 2, 2024

Conversation

teunbrand
Copy link
Collaborator

This PR aims to fix #6054.

Briefly, when oob breaks were discarded, atomic labels became out-of-sync. This PR discards such breaks after labels have been retrieved.

Reprex from issue:

devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2
data <- data.frame(x = 1:2)
ggplot(data) + 
  geom_col(aes(x, x, fill = x)) + 
  scale_fill_steps2(breaks = 1:3, labels = 1:3)

Created on 2024-08-27 with reprex v2.1.1

Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Merge branch 'main' into binned_breaks_labels_length

# Conflicts:
#	R/guide-bins.R
#	tests/testthat/test-guides.R
@teunbrand teunbrand merged commit f52de1c into tidyverse:main Dec 2, 2024
13 checks passed
@teunbrand teunbrand deleted the binned_breaks_labels_length branch December 2, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scale_x_steps2() throws an error when labels and breaks are manually specified
2 participants